﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Aga.Psad.Backend.Entities;

namespace Aga.Psad.Backend.Repositories
{
    public class BlogPostRepository : RepositoryBase<BlogPost>
    {
        public List<BlogPost> GetPage(int index, int pageSize)
        {
            var posts = GetAll().OrderByDescending(p => p.Fecha)
                                .Skip(index * pageSize)
                                .Take(pageSize)
                                .ToList();

            return posts;
        }
    }
}
